#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> pii;
// prority_queue<int, vecotr<int>, greater<int>> pq;

void solve() {
    int n;
    cin >> n;
    vector<int> a(n), b;
    map<int, int> mp;
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        mp[a[i]]++;
    } 
    for(auto x : a) {
        if(x > n) {
            cout << "NO\n";
            return;
        }
    }
    int p = n;
    for(int i = 1; i <= n; i++) {
        b.push_back(p);
        p -= mp[i];
    }
    for(int i = 0; i < n; i++) {
        if(a[i] != b[i]) {
            cout << "NO\n";
            return;
        }
    }
    cout << "YES\n";
}

signed main() {
    int t; cin >> t;
    while(t--) solve();
    return 0;
}